﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//猫、狗、鸭、猴，（吃、游泳、爬树）
namespace Demo
{
    class Program
    {
        static void Main(string[] args)
        {
            Cat CAT = new Cat();
            CAT.Iclimbtree();
            Console.WriteLine("------------------------------");

            Dog DOG = new Dog();
            DOG.Iswimming();
            Console.WriteLine("------------------------------");

            Duck DUC = new Duck();
            DUC.Iswimming();
            Console.WriteLine("------------------------------");

            Monkey MON = new Monkey();
            MON.Iclimbtree();
            Console.WriteLine("------------------------------");
        }
    }
    class Person 
    {
        public void Eat() 
        {
            Console.WriteLine("我能吃");
        }
    }
    interface ISwimming //游泳
    {
        void Iswimming();
    }
    interface IClimbtree //爬树
    {
        void Iclimbtree();
    }
    class Cat : Person, IClimbtree//猫
    {
        public void Iclimbtree()
        {
            base.Eat();
            Console.WriteLine("我会爬树");
        }
    }
    class Dog : Person, ISwimming //狗
    {
        public void Iswimming()
        {
            base.Eat();
            Console.WriteLine("我会游泳");
        }
    }
    class Duck : Person, ISwimming //鸭
    {
        public void Iswimming()
        {
            base.Eat();
            Console.WriteLine("我会游泳");
        }
    }
    class Monkey : Person, IClimbtree//猴
    {
        public void Iclimbtree()
        {
            base.Eat();
            Console.WriteLine("我会爬树");
        }
    }
}
